#include<bits/stdc++.h>
using namespace std;


typedef struct mystruct
{
	int sum;
	int n;
}ms;
ms Addnum(int x)
{
	ms content;
	int a = 0;
	content.sum=0;
	content.n=0;
	while (x)
	{
		a = x % 10;
		content.sum += a;
		x /= 10;
		content.n++;
	}
	
	return content;
}
int main()
{
	int size = 0;

	for (int i = 1; i <=9999; i++)
	{
		ms ans1 = Addnum(i);
		for (int j =0; j <=9999; j++)
		{
			ms ans2 = Addnum(j);
			if (ans1.n == ans2.n && ans1.sum == ans2.sum)
			{
				size++;
			}
		}

	}

	cout << size<<endl;
	
	return 0;
}